package com.big.sms.controller;

import com.big.common.result.Result;
import com.big.model.vo.sms.PaySmsVo;
import com.big.model.vo.sms.SendSmsDto;
import com.big.model.vo.sms.VerifyCodeDto;
import com.big.sms.service.SmsService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/api/sms/tx")
public class SmsController {

    @Autowired
    private SmsService smsService;

    @PostMapping("send")
    @ApiOperation(value = "发送短信")
    public Result send(@RequestBody SendSmsDto sendSmsDto) {
        smsService.sendSmsCode(sendSmsDto);
        return Result.ok();
    }


    @PostMapping("verify")
    public Result verify(@RequestBody VerifyCodeDto verifyCodeDto) {
        smsService.verifyCode(verifyCodeDto);
        return Result.ok();
    }


    @PostMapping("PaySend")
    public Result send(@RequestBody PaySmsVo paySmsVo) {
        smsService.sendSmsPay(paySmsVo);
        return Result.ok();
    }

    //提醒我
    @GetMapping("remind/{iphone}")
    public int remindMe(@PathVariable String iphone) {
        return smsService.RemindMe(iphone);
    }



    //发货提醒
    @GetMapping("shipments/{phone}/{oId}")
    public Integer shipments(@PathVariable String phone,@PathVariable String oId) {
        return smsService.shipments(phone,oId);
    }



}
